package cn.edu.experiment2;

public class Main {
    public static void main(String[] args) {
        /* ---------- 课程 ---------- */
        Course c1 = new Course("C001", "高等数学",   "教学楼 A101", "周一 3-4 节");
        Course c2 = new Course("C002", "计算机科学", "实验楼 B202", "周二 1-2 节");
        Course c3 = new Course("C003", "物理学",     "实验楼 C301", "周三 5-6 节");
        Course c4 = new Course("C004", "英语文学",   "教学楼 D401", "周四 3-4 节");
        Course c5 = new Course("C005", "机械设计",   "实训楼 E501", "周五 1-2 节");

        /* ---------- 教师 ---------- */
        Teacher t1 = new Teacher("T001", "张明");
        Teacher t2 = new Teacher("T002", "李红");
        Teacher t3 = new Teacher("T003", "王强");
        Teacher t4 = new Teacher("T004", "陈丽");
        Teacher t5 = new Teacher("T005", "刘伟");

        /* ========== 教师开课 ========== */
        System.out.println("========== 教师开课 ==========");
        t1.openCourse(c1);
        t2.openCourse(c2);
        t3.openCourse(c3);
        t4.openCourse(c4);
        t5.openCourse(c5);

        /* ---------- 学生 ---------- */
        Student s1 = new Student("S001", "赵晓");
        Student s2 = new Student("S002", "孙磊");
        Student s3 = new Student("S003", "周芳");
        Student s4 = new Student("S004", "吴涛");
        Student s5 = new Student("S005", "郑雪");

        /* ========== 学生选课 ========== */
        System.out.println("========== 学生选课 ==========");
        s1.select(c2);
        s2.select(c3);
        s3.select(c4);
        s4.select(c5);
        s5.select(c1);

        /* 新增：让 s1 再选两门，实现一人多课 */
        s1.select(c3);
        s1.select(c4);

        /* ========== 学生退课 ========== */
        System.out.println("========== 学生退课 ==========");
        s1.drop();       // 退最早选的那门（c2 计算机科学）
        s1.select(c1);   // 重新选高等数学

        /* ========== 学生课表 ========== */
        System.out.println("========== 所有学生课表 ==========");
        s1.printSchedule();
        s2.printSchedule();
        s3.printSchedule();
        s4.printSchedule();
        s5.printSchedule();
    }
}